package in.muton.edushare.pages.deptpages;

import in.muton.edushare.wicket.models.InnerList;
import in.muton.panels.paginator.EntityListing;
import in.muton.panels.paginator.badgehelpers.course.CourseBadgeInterface;

import java.util.List;

import org.apache.wicket.PageParameters;
import org.apache.wicket.model.IModel;

import com.edushare.common.constants.ApplicationConstants;
import com.edushare.common.vo.Courses;

public class DeptCourses extends DeptBase {

	public DeptCourses(PageParameters params) {
		super(params);
		CourseBadgeInterface cbi = new CourseBadgeInterface(getModel().getObject());
		add(new EntityListing<Courses>("thumbList", new InnerList<Courses>() {
			private static final long serialVersionUID = -8958887168246348317L;

			@Override
			public List<IModel<Courses>> getObject() {
				return dd.getCourses().getObject();
			}
		}, cbi, this));
	}
	

	@Override
	protected String getActivePage(PageParameters params) {
		return "deptCourses";
	}

	@Override
	public String getPageTitle() {
		return getLoggedInUser().getCompleteUserName() + " | "
		+ getModel().getObject().getDeptName()
		+ " | Courses | "
		+ ApplicationConstants.APPLICATION_NAME;		
	}

}
